﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using EntitiesLayer;

namespace BLL
{
    static class Extenciones
    {

        public static Dictionary<int, string> toDictionary(this IEnumerable<IEntity> lista)
        {

            Dictionary<int, string> dic = new Dictionary<int,string>();     
            foreach (IEntity e in lista)
                dic.Add(e.Id, e.Nombre);
            
            return dic.Count>0? dic : null;
        }
    
    }
}
